home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / printer / prngl126.zip / HPGL.DOC < prev    next >
Text File  |  1992-09-18  |  24KB  |  624 lines

  1.                                                              
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                               PrintGL 1.26 HP-GL Commands
  21.  
  22.  
  23.  
  24.  
  25.                       (C) Copyright Ravitz Software Inc. 1990,1992
  26.  
  27.  
  28.  
  29.             Ravitz Software Inc.                        BBS/FAX 606-268-0577
  30.             P.O. Box 25068
  31.             Lexington, KY  40524-5068
  32.             USA                            Compuserve Cary Ravitz [70431,32]
  33.  
  34.                                                                               
  35.  
  36.                                                                             p-1
  37.          Contents -------------------------------------------------------------
  38.  
  39.            Introduction ..................................................... 2
  40.            HP-GL Commands                                                     3
  41.            HP-GL Character Sets ............................................ 13
  42.                                                                               
  43.  
  44.                                                                             p-2
  45.          Introduction ---------------------------------------------------------
  46.  
  47.            This   document  is   a   description  of  the   subset   of   HP-GL
  48.            (Hewlett-Packard  Graphics  Language)  that is supported by PrintGL.
  49.            This  information was included in  PRINTGL.DOC with PrintGL 1.24 and
  50.            earlier shareware packages.  It is  now in a separate  file to  make
  51.            printing the PrintGL reference manual easier.
  52.  
  53.            If  you are using PrintGL to work with commercial graphics software,
  54.            then you will probably  not  need this manual.  If  you are  writing
  55.            HP-GL code you will find here  the information  needed to  make your
  56.            HP-GL compatible with PrintGL.
  57.                                                                               
  58.  
  59.                                                                             p-3
  60.          HP-GL Commands -------------------------------------------------------
  61.  
  62.            PrintGL's HP-GL specification is taken from the  programming manuals
  63.            for the HP 7475A, ColorPro (7440/17440), and 7550A.  The 7550 manual
  64.            is  the  best reference for HP-GL - HP  manual 07550-90001.  PrintGL
  65.            supports  the 7475, and 7440/17440 command sets except for character
  66.            set 8 (Katakana), digitize commands, output commands, the error mask
  67.            command, and some device control  commands.  Supported commands  are
  68.            listed below.  Commands that are not applicable to printing, such as
  69.            pen velocity, are  considered supported  but are completely ignored.
  70.            Commands that are not supported are flagged and then ignored.
  71.  
  72.            In addition, PG, AF,  ES,  LO,  character  set  5,  and proportional
  73.            spaced  fonts,  from the 7550,  are  supported.  And  forty pens are
  74.            allowed instead of eight.
  75.  
  76.            In reading a plotfile, PrintGL ignores carriage returns, line feeds,
  77.            and nulls  except where  they may be valid characters (LB,  SM,  DT,
  78.            esc.), and ASCII EOF (026) is interpreted as an end of file mark.
  79.  
  80.            AA x_center , y_center , arc_angle [, chord_angle]
  81.  
  82.              arc absolute
  83.  
  84.              AA moves the pen through an arc, starting at the current position,
  85.              with the pen in the current up/down state.
  86.  
  87.            AF
  88.  
  89.              advance full page (7550 extension)
  90.  
  91.              AF starts a new plot. PrintGL starts every page with the pen up at
  92.              0,0.
  93.  
  94.            AP
  95.  
  96.              automatic pen pickup - IGNORED
  97.  
  98.            AR x_center_delta , y_center_delta , arc_angle [, chord_angle]
  99.  
  100.              arc relative
  101.  
  102.              AR moves the pen through an arc, starting at the current position,
  103.              with the pen in the current up/down state.
  104.  
  105.            CA character_set
  106.  
  107.              designate alternate character set
  108.  
  109.              See HP-GL Character Sets for a list of character sets.
  110.  
  111.            CI radius [, chord_angle]
  112.  
  113.              circle
  114.  
  115.              CI draws a  circle centered at the current position.  The  current
  116.              up/down state and position are unchanged by a CI command.
  117.                                                                               
  118.  
  119.                                                                             p-4
  120.            CP [spaces , lines]
  121.  
  122.              character plot
  123.  
  124.              CP  moves  the  pen by character spaces (+ is  along the text) and
  125.              lines  (+  is  up),  using  the current up/down  state.  Using  no
  126.              parameters is the same as a carriage return/line feed.
  127.  
  128.            CS character_set
  129.  
  130.              designate standard character set
  131.  
  132.              See HP-GL Character Sets for a list of character sets.
  133.  
  134.            DF
  135.  
  136.              default values
  137.  
  138.              This sets default values for the following commands:  CA,  CS, DR,
  139.              DT, ES, FT, IW, LO, LT, PA, PT, SC, SM, SL, SR, SS, TL.
  140.  
  141.            DI [run , rise]
  142.  
  143.              absolute character direction
  144.  
  145.              DI sets the baseline direction for labels.  The default is 1,0.
  146.  
  147.            DR [run , rise]
  148.  
  149.              relative character direction
  150.  
  151.              DR  sets the baseline  direction  for labels.  Run  and rise are a
  152.              percentage of P2X-P1X and P2Y-P1Y. The default is 1,0.
  153.  
  154.            DTt
  155.  
  156.              define label terminator
  157.  
  158.              The label terminator ends an LB command. The default is ASCII 003.
  159.  
  160.            EA x_opposite_corner , y_opposite_corner
  161.  
  162.              edge rectangle absolute
  163.  
  164.              EA  draws a  rectangle defined  by  the  current position  and the
  165.              parameters. The pen position and up/down state are unchanged.
  166.  
  167.            EC
  168.  
  169.              enable cutter - IGNORED
  170.  
  171.            EP
  172.  
  173.              edge polygon
  174.  
  175.              EP draws  the  current  polygon  edge.  Any  pen  up/down used  in
  176.              creating the polygon is respected in drawing the edge.
  177.                                                                               
  178.  
  179.                                                                             p-5
  180.            ER x_opposite_corner_delta , y_opposite_corner_delta
  181.  
  182.              edge rectangle relative
  183.  
  184.              ER draws a rectangle with corners defined  by the current position
  185.              and the command  parameters.  The current pen position and up/down
  186.              state are unchanged.
  187.  
  188.            ES [ space [, line]]
  189.  
  190.              extra space (7550 extension)
  191.  
  192.              ES adds to the space between characters and  lines.  The units are
  193.              in character cells (1.5*width, 2*height).  The allowed range is -1
  194.              to 1. -.3333 causes characters to touch.
  195.  
  196.            EW radius , start_angle , sweep_angle [, chord_angle]
  197.  
  198.              edge wedge
  199.  
  200.              EW draws a wedge centered at the current position. The current pen
  201.              position and up/down state are unchanged.
  202.  
  203.            FP
  204.  
  205.              fill polygon
  206.  
  207.              FP  fills  the  current  polygon.  Pen up/down  commands  used  in
  208.              creating the polygon are ignored.
  209.  
  210.              There is a limit of 2000 fill line segments per polygon.
  211.  
  212.            FT [type [, spacing [, angle]]]
  213.  
  214.              fill type
  215.  
  216.              These are  the  fill types.  Type  2  is identical to  type 1  for
  217.              PrintGL.
  218.  
  219.                1  solid lines spaced at half the pen thickness (see PT command)
  220.                2  unidirectional solid lines spaced at half the pen thickness
  221.                3  lines at the specified spacing
  222.                4  cross hatched lines at the specified spacing
  223.                5  type ignored
  224.  
  225.              A spacing  parameter  of 0 sets  the  spacing  to 1%  of the P1-P2
  226.              diagonal. Spacing is in x axis units (this is only relevant if the
  227.              axes have different scaling).  PrintGL supports any  integer angle
  228.              for fill. Cross hatched lines are at angle + 90.
  229.  
  230.            IN
  231.  
  232.              initialize
  233.                                                                               
  234.  
  235.                                                                             p-6
  236.            IP [p1x , p1y [, p2x , p2y]]
  237.  
  238.              sets scaling points P1 and P2
  239.  
  240.              IP sets the scaling points (P1 and P2) in plotter units. P1 and P2
  241.              are used by several commands to help with size independent plots.
  242.  
  243.            IW [x_lower_left , y_lower_left , x_upper_right , y_upper_right]
  244.  
  245.              input window
  246.  
  247.              IW sets a  clipping window in plotter units.  With  no parameters,
  248.              the clipping window is turned off.
  249.  
  250.              If  PrintGL's  /YE switch is  set and user  scaling  is on then IW
  251.              parameters are in user units.  In this case the window is rescaled
  252.              with an IP command, but any SC command locks the current window.
  253.  
  254.            LB..text..terminator
  255.  
  256.              label
  257.  
  258.              Labels use  the current character set, based on CA, CS, SA, and SS
  259.              commands. See HP-GL Character Sets for font specifics.
  260.  
  261.            LO [ position_number ]
  262.  
  263.              label origin (7550 extension)
  264.  
  265.              LO sets the label origin.  The label origin relative to the  label
  266.              is  shown in the diagram below.  For positions 4..9 and 14..19 the
  267.              label buffer is limited to 150 characters. The default is 1.
  268.  
  269.              13                     16                      19
  270.                 3......  .......  ...6...  .......  ......9
  271.                 .     .  .     .  .     .  .     .  .     .
  272.              12 2     .  .     .  .  5  .  .     .  .     8 18
  273.                 .     .  .     .  .     .  .     .  .     .
  274.                 1......  .......  ...4...  .......  ......7
  275.              11                     14                      17
  276.  
  277.            LT [pattern_number [, pattern_length]]
  278.  
  279.              line type
  280.  
  281.              PrintGL's line type patterns  are close to, but not  identical  to
  282.              HP's.  Pattern length is a percentage of the P1-P2 diagonal with a
  283.              default of 4%.  Patterns are limited to a minimum length of 4 dots
  284.              for types 1 and 2 and 16 dots for other types.
  285.  
  286.              no parameter  solid            1  ∙               ∙
  287.                                             2  ────────        ────────
  288.              0             dots at          3  ────────────    ────────────
  289.                            endpoints        4  ────────────  ∙ ────────────  ∙
  290.                            only             5  ──────────  ──  ──────────  ──
  291.                                             6  ──────  ──  ──  ──────  ──  ──
  292.                                                                               
  293.  
  294.                                                                             p-7
  295.            PA [x , y] [, x , y] ...
  296.  
  297.              plot absolute
  298.  
  299.              PA sets absolute mode and optionally moves the  pen in the current
  300.              up/down state.
  301.  
  302.            PD [x , y] [, x , y] ...
  303.  
  304.              pen down
  305.  
  306.              PD sets  the pen  down and optionally  moves  it with  the current
  307.              absolute/relative mode.
  308.  
  309.            PG [i]
  310.  
  311.              new page (7550 extension)
  312.  
  313.              PG starts  a new  plot.  The parameter is ignored.  PrintGL starts
  314.              every page with the pen up at 0,0.
  315.  
  316.            PM i
  317.  
  318.              polygon mode
  319.  
  320.              PM 0 starts polygon mode.  The current position is the first point
  321.              in the polygon.
  322.  
  323.              PM 1 starts  a new  subpolygon.  The  position after the next  pen
  324.              movement is the first point in the subpolygon.  The first pen move
  325.              of a subpolygon is done with the pen up, regardless of the current
  326.              up/down status.
  327.  
  328.              PM 2 ends polygon mode.
  329.  
  330.              PM  1 and PM 2 close  the current subpolygon with  the current pen
  331.              up/down state. If used without first starting polygon mode (PM 0),
  332.              PrintGL adds an implied PM 0 before processing the PM 1 or PM 2.
  333.  
  334.              The following  commands are accepted in polygon  mode: PM, PA, PR,
  335.              PU, PD,  AA,  AR,  CI  (circles  are  automatically  prefixed  and
  336.              suffixed by PM 1), and IN (ends polygon mode).
  337.  
  338.              The polygon buffer is limited to 500 data points.
  339.  
  340.            PR [x_delta , y_delta] [, x_delta , y_delta] ...
  341.  
  342.              plot relative
  343.  
  344.              PR sets relative mode and optionally moves the  pen in the current
  345.              up/down state.
  346.  
  347.            PS
  348.  
  349.              paper size - IGNORED
  350.  
  351.              PrintGL ignores PS. The paper size must be set with the /L option.
  352.                                                                               
  353.  
  354.                                                                             p-8
  355.            PT [thickness]
  356.  
  357.              pen thickness
  358.  
  359.              PT specifies twice the line spacing used in solid fills and may be
  360.              from 0 to 5.0 mm. It is reset to .3 mm with each SP command.
  361.  
  362.            PU [x,y] [,x,y] ...
  363.  
  364.              pen up
  365.  
  366.              PU  raises  the  pen  and  optionally  moves it with  the  current
  367.              absolute/relative mode.
  368.  
  369.            RA x_opposite_corner , y_opposite_corner
  370.  
  371.              shade rectangle absolute
  372.  
  373.              RA  fills a rectangle with corners defined by the current position
  374.              and the command parameters.  The current pen  position and up/down
  375.              state are unchanged. The rectangle edge is not drawn.
  376.  
  377.            RO [angle]
  378.  
  379.              rotated coordinate system
  380.  
  381.              RO or RO0 sets up a normal coordinate system. RO90, the only other
  382.              allowed  value, sets up a system that is rotated  90 degrees.  The
  383.              type of rotation depends on the paper size.  This command does not
  384.              change the scaling points, so an IP command is useful after an RO.
  385.  
  386.              The HP 7475 specifies two different meanings for RO90 depending on
  387.              the  paper  size (A/A4 or B/A3).  PrintGL  decides  which  type of
  388.              rotation to do based on the sum of  the  print  window  width  and
  389.              height.  If this sum  is  greater than 24 inches  then large paper
  390.              rotation is used. Otherwise, small paper rotation is used.
  391.  
  392.              Small paper rotation:              Large paper rotation:
  393.  
  394.              RO 0             RO 90             RO 0             RO 90
  395.  
  396.                y┌────────┐   0,0┌────────┐y     0,0┌────────┐y    y┌────────┐
  397.                 │        │      │        │         │        │      │        │
  398.                 │        │      │        │         │        │      │        │
  399.              0,0└────────┘x    x└────────┘         │        │      │        │
  400.                                                    │        │      │        │
  401.                                                    │        │      │        │
  402.                                                    │        │      │        │
  403.                                                   x└────────┘   0,0└────────┘x
  404.  
  405.            RR x_opposite_corner_delta , y_opposite_corner_delta
  406.  
  407.              shade rectangle relative
  408.  
  409.              RR  fills a rectangle with corners defined by the current position
  410.              and the command parameters.  The current pen  position and up/down
  411.              state are unchanged. The rectangle edge is not drawn.
  412.                                                                               
  413.  
  414.                                                                             p-9
  415.            SA
  416.  
  417.              select alternate character set
  418.  
  419.              SA specifies the alternate character set as current. The alternate
  420.              character set is chosen with CA.
  421.  
  422.            SC [xmin , xmax , ymin , ymax]
  423.  
  424.              scaling
  425.  
  426.              SC  sets user units for subsequent drawing.  The units are defined
  427.              by  user values for P1 (xmin,ymin)  and  P2 (xmax,ymax).  Using no
  428.              parameters  turns  scaling off, and  subsequent drawing is done in
  429.              plotter units (1/1016 inch).
  430.  
  431.            SI [width , height]
  432.  
  433.              character size absolute
  434.  
  435.              SI sets the capital letter  box  width and height  in centimeters.
  436.              Letter  spacing  is  1.5  *  width and line spacing is 2 * height.
  437.              Using no parameters with B or A3 paper is the  same as SI.285,.375
  438.              and any other paper is the same as SI.187,.269.
  439.  
  440.            SL [tan_angle]
  441.  
  442.              character slant
  443.  
  444.              SL sets the character slant.  The parameter is  interpreted as the
  445.              tangent  of  the angle from vertical.  Using no parameter sets the
  446.              slant to 0 degrees.
  447.  
  448.            SM[c]
  449.  
  450.              symbol mode
  451.  
  452.              SM  sets symbol  mode, which centers  the symbol mode character at
  453.              any plotted point.  Any character from ASCII 033 to 127 except ";"
  454.              sets symbol mode. Any other character turns symbol mode off.
  455.  
  456.            SP pen_number
  457.  
  458.              select pen
  459.  
  460.              SP selects a pen.  Using 0 or no parameter stores the pen  without
  461.              selecting a new pen.  This is usually done at the  end of a  plot.
  462.              PrintGL ignores any drawing with pen 0.
  463.  
  464.            SR [width , height]
  465.  
  466.              character size relative
  467.  
  468.              SR sets the capital letter box width and height as a percentage of
  469.              P2X-P1X  and P2Y-P1Y.  Letter  spacing is 1.5  *  width  and  line
  470.              spacing  is  2  *  height.  Using no  parameters  is the  same  as
  471.              SR.75,1.5.
  472.                                                                               
  473.  
  474.                                                                            p-10
  475.            SS
  476.  
  477.              select standard character set
  478.  
  479.              SS specifies the standard character  set as current.  The standard
  480.              character set is chosen with CS.
  481.  
  482.            TL [positive_length [, negative length]]
  483.  
  484.              tick length
  485.  
  486.              TL sets the tick lengths  used by XT and YT.  The  parameters  are
  487.              lengths above  and  below the current position as a  percentage of
  488.              P2Y-P1Y for x-axis ticks and  a percentage of  P2X-P1X  for y-axis
  489.              ticks.
  490.  
  491.            UC [[pen_control ,] x_delta , y_delta] ...
  492.  
  493.              user character
  494.  
  495.              UC specifies  a user defined character.  The pen control number is
  496.              99 for pen down  or -99  for pen  up.  Pen movements are relative,
  497.              with x_delta in  units  of 1/4 the character  width and y_delta in
  498.              units of 1/8 the character height.
  499.  
  500.            VA
  501.  
  502.              adaptive velocity - IGNORED
  503.  
  504.            VN
  505.  
  506.              normal velocity - IGNORED
  507.  
  508.            VS
  509.  
  510.              pen velocity - IGNORED
  511.  
  512.            WG radius , start_angle , sweep_angle [, chord_angle]
  513.  
  514.              shade wedge
  515.  
  516.              WG fills a wedge centered at the current position. The current pen
  517.              position and up/down  state are unchanged.  The wedge  edge is not
  518.              drawn.
  519.  
  520.            XT
  521.  
  522.              x-axis tick
  523.  
  524.              XT draws a vertical line, with length specified by the TL command,
  525.              at  the current position.  The pen position  and up/down state are
  526.              unchanged.
  527.                                                                               
  528.  
  529.                                                                            p-11
  530.            YT
  531.  
  532.              y-axis tick
  533.  
  534.              YT draws  a  horizontal  line,  with length  specified  by  the TL
  535.              command, at the  current position.  The  pen position  and up/down
  536.              state are unchanged.
  537.  
  538.            esc.(
  539.            esc.Y
  540.  
  541.              plotter on
  542.  
  543.              Esc.(  and esc.Y turn the plotter on.  This is only relevant  with
  544.              the /YY option.
  545.  
  546.            esc.)
  547.            esc.Z
  548.  
  549.              plotter off
  550.  
  551.              Esc.) and esc.Z turn the plotter off. They are only effective with
  552.              the /YY option.  The plotter on  and off commands let you  include
  553.              comments  or  data  to  pass through  to  another  device  in  the
  554.              plotfile. These are flagged as unsupported commands if /YD is set,
  555.              as an indication that you should set /YY.
  556.  
  557.            esc.@, esc.H, esc.I, esc.M, esc.N, esc.R
  558.  
  559.              RS-232 device control commands - IGNORED
  560.                                                                               
  561.  
  562.                                                                            p-12
  563.          HP-GL Character Sets -------------------------------------------------
  564.  
  565.            PrintGL  supports all of the character sets that  are included  with
  566.            the HP 7475 and 7440/17440 except Katakana, and adds character set 5
  567.            and  the  proportional  spaced  fonts   from  the  7550.   PrintGL's
  568.            characters are similar to but not identical to HP's.
  569.  
  570.               0  ANSI ASCII
  571.               1  9825 character set
  572.               2  French/German
  573.               3  Scandinavian
  574.               4  Spanish/Latin American
  575.               5  Special Symbols (7550 extension)
  576.               6  JIS ASCII
  577.               7  Roman Extensions
  578.               8  Katakana - NOT SUPPORTED BY PRINTGL
  579.               9  ISO IRV (International Reference Version)
  580.              30  ISO Swedish
  581.              31  ISO Swedish For Names
  582.              32  ISO Norway Version 1
  583.              33  ISO German
  584.              34  ISO French
  585.              35  ISO United Kingdom
  586.              36  ISO Italian
  587.              37  ISO Spanish
  588.              38  ISO Portuguese
  589.              39  ISO Norway Version 2
  590.  
  591.            The character sets specify a font for codes 033..127. Codes 000..032
  592.            and 128..255 are independent of the character set and are all no ops
  593.            except these.
  594.  
  595.              003  default label terminator
  596.              008  backspace
  597.              009  half backspace
  598.              010  line feed
  599.              011  reverse line feed
  600.              013  carriage return
  601.              014  select alternate character set
  602.              015  select standard character set
  603.              032  space
  604.  
  605.            Each of  the  character sets  is available as a proportional font by
  606.            adding 10 to the set number.  The proportional  fonts  are kerned to
  607.            improve  appearance (the character spacing is adjusted to compensate
  608.            for  character shape).  Use the LO  command to simplify working with
  609.            proportional fonts. To improve the appearance of large text, use the
  610.            ES command to reduce the character spacing.
  611.  
  612.            Codes 65 to 81 in character set 5 are symbols designed to be used in
  613.            symbol mode (SM command) or as one character labels.  When used in a
  614.            label (LB command) these characters  are centered at the current pen
  615.            position and leave the pen position unchanged.
  616.                                                                               
  617.  
  618.                                                                            p-13
  619.            The  HP-GL  characters cannot  be printed  with  the  standard ASCII
  620.            character  set.  The file HPGL.CHR is an HP-GL file that can be used
  621.            to print a  replacement  for this page, showing  the character sets.
  622.            Use  the command PRINTGL  HPGL.CHR  /M1  /AO0,0  with  a  /F  option
  623.            specific to your printer to do this.
  624.